package test3_12;

import java.util.Arrays;

public class Test_select {
    public static void main(String[] args) {
        int min;
        int index;
        int[] arr = {2, 5, 3, 8, 1, 0, 6};
        for (int i = 0; i < arr.length - 1; i++) {
            min = arr[i];
            index = i;
            for (int j = i + 1; j < arr.length; j++) {
                if (min > arr[j]) {
                    min = arr[j];
                    index = j;
                }
            }
            if (index != i) {
                arr[index] = arr[i];
                arr[i] = min;
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}